[qemu] Sync data to disk if write cache is disabled.
authorChristian Limpach <Christian.Limpach@xensource.com>
Thu, 10 May 2007 12:57:13 +0000 (13:57 +0100)
committerChristian Limpach <Christian.Limpach@xensource.com>
Thu, 10 May 2007 12:57:13 +0000 (13:57 +0100)
Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
tools/ioemu/hw/ide.c

index 2b58efb870f748229e10beffb711fc9cfa0c8e94..f681236b248ba43c77776984d45a3a6baffb3b58 100644 (file)
@@ -968,6 +968,9 @@ static void ide_write_dma_cb(void *opaque, int ret)
 
     /* end of transfer ? */
     if (s->nsector == 0) {
+        /* Ensure the data hit disk before telling the guest OS so. */
+        if (!s->write_cache)
+            bdrv_flush(s->bs);
         s->status = READY_STAT | SEEK_STAT;
         ide_set_irq(s);
     eot: